package MyQueue;

public class MyQueue {
    //基于链表来实现一个队列
    class Node {
        String val;
        Node next;
        public Node(String val){
            this.val=val;
            this.next=null;
        }
    }
    private Node head=null;
    public Node tail=null;
    public  void wei(String val){
        Node node =new Node(val);
        if(head==null){
            head=node;
            tail=node;
        }
        tail.next=node;
        tail=node;
    }
    public String toushan(){
        String a=head.val;
        head=head.next;
        if(head==null){
            tail=null;
        }
        return a;
    }
    public String peek(){
        if(head==null)return null;
        return head.val;
    }

    public static void main(String[] args) {
        //MyQueue
    }
}
